package com.woniu.liuzhougov.systemSettings.controller;

import com.woniu.liuzhougov.itemAndTask.pojo.CheckStatus;
import com.woniu.liuzhougov.systemSettings.service.CheckStatusService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 系统参数
 * @Author: yuetang
 * @Date: 2019-04-23 16:08
 */
@Controller
public class CheckStatusController {

    @Resource
    private CheckStatusService checkStatusService;
    //全部查询
    @RequiresPermissions("CheckStatus_selAll")
    @RequestMapping("/CheckStatus/selAll")
    @ResponseBody
    public Map selAll(){
        List<CheckStatus> list = checkStatusService.selAll();
        Map<String,Object> map = new HashMap<>();
        map.put("count",list.size());
        map.put("data",list);
        map.put("code",0);
        map.put("msg","");
        return map;
    }

    //添加
    public String insert(CheckStatus checkStatus){

        return checkStatusService.insert(checkStatus);
    }

    //修改
    public String update(CheckStatus checkStatus){

        return checkStatusService.update(checkStatus);
    }

    //删除
    public String delete(int checkStatusId){

        return checkStatusService.delete(checkStatusId);
    }
}
